<div style="padding:20px">
    <div class="layui-clear">
        <form method="GET" action="/game/admin/yuyue_user/pid/{$_GET['pid']}" class="fr layui-form" style="width:330px;">
            <div class="layui-input-inline fl" style="width:100px;">
                <php>$types = ['mobile'=>'手机号'];</php>
                <select name="searchtype">
                    <foreach name="types" item="vo" key="k">
                        <option value="{$k}" <if condition="$_GET['searchtype'] eq $k">selected</if>>{$vo}</option>
                    </foreach>
                </select>
            </div>
            <div class="layui-input-inline fr" style="width:230px;">
                <button class="layui-btn fr" lay-submit>搜索</button>
                <input type="text" class="layui-input fr" style="width:160px;" name="keywords" placeholder="请输入关键词" value="{$_GET['keywords']}">
            </div>
            <php> $condition = $_GET['searchtype'] && $_GET['keywords'] ? "/searchtype/A.".$_GET['searchtype']."/keywords/".$_GET['keywords'] : '';</php>
            <script>
                var condition = '{$condition}';
            </script>
        </form>
    </div>
    <table id="list" lay-skin="line"></table>
    <script type="text/html" id="barDemo">
        <div class="action-btn">
            <a class="mini_del" href="javascript:;" data-url="/game/api_admin/del_yuyue_user/ids/{{d.id}}">删除</a>
            <a class="" href="javascript:;" onclick="think_open('/game/admin/yuyue_user_edit?id={{d.id}}','修改',['90%','90%'],0)">修改</a>
        </div>
    </script>
</div>

<script>
    layui.use(['think'], function() {
        var think = layui.think;

        //第一个实例
        think.render({
            elem: '#list',
            // height: 500,
            url: '/game/api_admin/getdata_yuyue_user/pid/{$_GET["pid"]}' + condition,
            toolbar: false,
            skin: 'line',
            cols: [
                [ //表头
                    {
                        type: 'checkbox'
                        // fixed: 'left'
                    }, {
                        field: 'id',
                        title: 'ID',
                        width: 80
                        // sort: true,
                        // fixed: 'left'
                    }, {
                        field: 'mobile',
                        title: '手机号',
                        sort: true
                    }, {
                        field: 'remark',
                        title: '备注',
                    },  {
                        field: 'status',
                        title: '状态',
                        width: 80,
                        templet: function(d) {
                            var tmp = '<span style="color:#999">待定</span>';
                            switch (parseInt(d.status)) {
                                case 0:
                                    break;
                                case 1:
                                    tmp = '<span class="xy-status">成功</span>';
                                    break;
                                case -1:
                                    tmp = '<span class="xy-status red">隐藏</span>';
                                    break;
                                default:
                                    tmp = '<span style="color:#CCC">未定义</span>';
                            }
                            return tmp;
                        }
                    }, {
                        field: 'create_time',
                        title: '预约时间',
                        width: 180,
                        templet: function(d) {
                            return think_time(d.create_time, 'Y-m-d H:i:s'); //think_time()是think.js里面的方法
                        }
                    }, {
                    title: '操作',
                    width: 150,
                    align: 'center',
                    toolbar: '#barDemo'
                    }
                ]
            ]
        }, '{$_GET["searchtype"]}', '{$_GET["keywords"]}');
    });
</script>